use salvo::oapi::extract::JsonBody;
use salvo::prelude::*;
use serde::Serialize;


/// hello world
#[handler]
pub async fn hello_world() -> String {
    "Hello, World!".to_owned()
}

#[derive(Serialize, Debug)]
pub struct ResponseUser {
    name: String,
    age: u32,
    email: String,
}

/// hello json
#[handler]
pub async fn hello_json() -> Json<ResponseUser> {
    Json(ResponseUser {
        name: "John".to_owned(),
        age: 30,
        email: "john@example.com".to_owned(),
    })
}